3 subject="""comment 4"""
4 date="2023-04-25T17:49:23Z"
6 What should enable that new json output for exceptions,
7 --json-error-messages or a new option like --json-exceptions?
9 The risk is that, since this is a new object type, it breaks a json
10 consumer that expects to find a `{"command":...}` object.
12 I do think that git-annex should be free to add new fields to existing json
13 objects. But adding a new object type seems considerably more risky.
14 git-annex has never done that before (eg --json-progress outputs the
15 "command" object with updated values).
17 I took a look at datalad's parsing of json from git-annex, to see what it might
18 do if it got a new object type unexpectedly. I'm not convinced it wouldn't
19 misbehave. For example, in `datalad/interface/results.py` `annexjson2result`:
21 res['status'] = 'ok' if d.get('success', False) is True else 'error'
23 Without a "status" field this will yield "error" which could go on to
24 cause unexpected behavior
26 So, I think this would need to be a new --json-exceptions option.